<?php

namespace App\Models\Content;

use App\Traits\ModelTrait;
use Illuminate\Database\Eloquent\Model;

class Tags extends Model
{
    use ModelTrait;
    protected $table = 'articles_tags';
    protected $fillable = ['name', 'sort', 'status'];

    //与文章多对多关联
    public function articles()
    {
        return $this->belongsToMany(Article::class, 'articles_has_tags', 'tag_id', 'article_id');
    }
}
